home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / unzip42.zip / OS2.ZIP / SHIP.DIF < prev    next >
Text File  |  1992-03-12  |  4KB  |  152 lines

  1. diff -cb unzip/ship.c unzip-2/ship.c
  2. *** unzip/ship.c    Wed Jan 29 15:17:28 1992
  3. --- unzip-2/ship.c    Wed Mar 11 23:02:22 1992
  4. ***************
  5. *** 26,31 ****
  6. --- 26,36 ----
  7.   #  endif /* MAILX */
  8.   #endif /* sgi */
  9.   
  10. + #ifdef __IBMC__        /* IBM C Set/2 (32-bit) for OS/2 2.0 */
  11. + #  define MSDOS
  12. + #  define mktemp tmpnam
  13. + #endif /* __IBMC__ */
  14.   #ifdef VMS
  15.   #  define TMPNAME "_SXXXXXX."
  16.   #  define MAILCMD "mail %s /subj=\"%s %s%s\" \"%s\""
  17. ***************
  18. *** 43,50 ****
  19. --- 48,59 ----
  20.   #  endif /* ?MAILX */
  21.   #  ifdef MSDOS
  22.   #    define PATHCUT '\\'
  23. + #    define RBMODE "rb"
  24. + #    define WBMODE "wb"
  25.   #  else /* !MSDOS */
  26.   #    define PATHCUT '/'
  27. + #    define RBMODE "r"
  28. + #    define WBMODE "w"
  29.   #  endif /* ?MSDOS */
  30.   #endif /* ?VMS */
  31.   
  32. ***************
  33. *** 257,272 ****
  34.   #endif /* ?MSDOS */
  35.   
  36.   
  37. - /* Define MSVMS if either MSDOS or VMS defined */
  38. - #ifdef MSDOS
  39. - #  define MSVMS
  40. - #else /* !MSDOS */
  41. - #  ifdef VMS
  42. - #    define MSVMS
  43. - #  endif /* VMS */
  44. - #endif /* ?MSDOS */
  45.   /* Define void, voidp, and extent (size_t) */
  46.   #include <stdio.h>
  47.   #ifdef MODERN
  48. --- 266,271 ----
  49. ***************
  50. *** 317,334 ****
  51.   #endif /* ?MODERN */
  52.   
  53.   
  54. - /* Fine tuning */
  55. - #ifndef MSDOS
  56. - #   define BSZ 8192   /* Buffer size for files */
  57. - #else /* !MSDOS */
  58. - #   define BSZ 4096   /* Keep precious NEAR space */
  59. -     /* BSZ can't be 8192 even for compact model because of 64K limitation
  60. -      * in im_lmat.c. If you run out of memory when processing a large number
  61. -      * files, use the compact model and reduce BSZ to 2048 here and in
  62. -      * im_lm.asm.
  63. -      */
  64. - #endif /* ?MSDOS */
  65.   /* end of tailor.h */
  66.   
  67.   #ifdef MODERN
  68. --- 316,321 ----
  69. ***************
  70. *** 390,396 ****
  71.   char mpspc[9];          /* prealloced space for prefix */
  72.   char *mprefix = mpspc;  /* identification for this mailing */
  73.   char *mdest;            /* mail destination */
  74. ! char mname[10];         /* temporary file name if mailing */
  75.   ulg ccnt;               /* count of bytes read or written */
  76.   int noisy = 1;          /* false to inhibit informational messages */
  77.   
  78. --- 377,383 ----
  79.   char mpspc[9];          /* prealloced space for prefix */
  80.   char *mprefix = mpspc;  /* identification for this mailing */
  81.   char *mdest;            /* mail destination */
  82. ! char mname[64];         /* temporary file name if mailing */
  83.   ulg ccnt;               /* count of bytes read or written */
  84.   int noisy = 1;          /* false to inhibit informational messages */
  85.   
  86. ***************
  87. *** 544,554 ****
  88.   {
  89.     cfile *c;             /* allocated cfile structure */
  90.   
  91. - #ifdef MSDOS
  92. -   /* Set file mode to binary for MSDOS systems */
  93. -   setmode(fileno(f), O_BINARY);
  94. - #endif /* MSDOS */
  95.     /* Allocate and fill structure */
  96.     if ((c = (cfile *)malloc(sizeof(cfile))) != NULL)
  97.     {
  98. --- 531,536 ----
  99. ***************
  100. *** 1039,1045 ****
  101.             err(SE_OVER, r);
  102.           }
  103.   #endif /* !VMS */
  104. !         else if ((f = fopen(r, "w")) == NULL)
  105.             err(SE_FULL, r);
  106.           if ((c = chook(f)) == NULL)
  107.             err(SE_MEM, "");
  108. --- 1021,1027 ----
  109.             err(SE_OVER, r);
  110.           }
  111.   #endif /* !VMS */
  112. !         else if ((f = fopen(r, WBMODE)) == NULL)
  113.             err(SE_FULL, r);
  114.           if ((c = chook(f)) == NULL)
  115.             err(SE_MEM, "");
  116. ***************
  117. *** 1149,1154 ****
  118. --- 1131,1141 ----
  119.     /* No subject prefix yet */
  120.     *mprefix = 0;
  121.   
  122. + #ifdef MSDOS
  123. +   if ( argc == 1 && isatty(0) )
  124. +     help();
  125. + #endif
  126.     /* See if help requested */
  127.     if (argc > 1 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "-?") == 0))
  128.       help();
  129. ***************
  130. *** 1249,1255 ****
  131.           else                            /* arg is file to ship */
  132.           {
  133.             s = 0;
  134. !           if ((f = fopen(argv[r], "r")) == NULL)
  135.               err(SE_FIND, argv[r]);
  136.             if (mail && !*mprefix)
  137.             {
  138. --- 1236,1242 ----
  139.           else                            /* arg is file to ship */
  140.           {
  141.             s = 0;
  142. !           if ((f = fopen(argv[r], RBMODE)) == NULL)
  143.               err(SE_FIND, argv[r]);
  144.             if (mail && !*mprefix)
  145.             {
  146.